﻿using Microsoft.Xna.Framework;

namespace Tequila.AugmentedReality.CameraStates
{
    internal class PortraitCameraBaseState : CameraBaseState
    {
        public PortraitCameraBaseState(int layoutWidth, int layoutHeight, int radius) : base(layoutWidth, layoutHeight, radius)
        {
        }

        protected override void SetCameraView()
        {
            View = Matrix.CreateLookAt(Vector3.UnitZ, Vector3.Zero, Vector3.Up);
        }

        protected override Vector3 ProjectPlacePosition(Matrix rotation, Vector3 placeVector)
        {
            var attitude = ConvertRotationToXNACoordinates(rotation);
            var world = Matrix.CreateWorld(placeVector, Vector3.UnitZ, Vector3.Up);
            return ProjectVectorToScreenCoordinates(attitude, world);
        }
    }
}
